<template>
	<view>
		<!-- logo背景图 -->
		<logoBack :back="false"></logoBack>

		<!-- from表单 -->
		<view class="form">
			<view class="formCenter">
				<view class="inputView">
					<view class="label">
						<image src="@/static/img/login/account.png" class="accountLabel" mode=""></image>
					</view>
					<view class="input">
						<input placeholder-class="inputPla" type="text" placeholder="请输入账号" />
					</view>
				</view>
				<view class="inputView">
					<view class="label">
						<image src="@/static/img/login/password.png" class="passwordLabel" mode=""></image>
					</view>
					<view class="input">
						<input type="password" placeholder-class="inputPla" placeholder="请输入密码" />
					</view>
					<view class="forgetPassword" @click="toForgetPwd">
						忘记?
					</view>
				</view>
				<view class="inputView loginButton" @click="login">
					<text>登录</text>
				</view>
				<view class="inputView registerButton" @click="toRegister">
					<text>注册</text>
				</view>
			</view>
		</view>

		<!-- agree -->
		<agree @agreeChange="handleAgreeChange"></agree>
	</view>
</template>

<script>
	import logoBack from "./components/logoBack.vue"
	import agree from "./components/agree.vue"
	export default {
		data() {
			return {
				agree: false
			}
		},
		components: {
			logoBack,
			agree
		},
		onShow() {

		},
		onLoad() {

		},
		methods: {
			// 去注册页面
			toRegister() {
				uni.navigateTo({
					url: "/pages/login/register"
				})
			},
			// 去忘记密码页面
			toForgetPwd() {
				uni.navigateTo({
					url: "/pages/login/forgetPwd"
				})
			},
			// 获取agree的判断值
			handleAgreeChange(value) {
				this.agree = value;
			},
			// 登录事件
			login() {

			}
		}
	}
</script>

<style lang="less" scoped>
	.form {
		margin-top: calc(43.5rpx * 2);
		display: flex;
		justify-content: center;

		.inputView {
			width: 600rpx;
			height: 100rpx;
			background-color: #F6F9FE;
			border-radius: 50rpx;
			margin-bottom: 35rpx;
			display: flex;
			position: relative;

			.label {
				padding-left: 41rpx;

				.accountLabel {
					padding-top: 28rpx;
					padding-bottom: 27rpx;
					width: 45rpx;
					height: 45rpx;
				}

				.passwordLabel {
					padding-top: 46rpx;
					padding-bottom: 31rpx;
					width: 47rpx;
					height: 23rpx;
				}
			}

			.input {
				// padding: 36rpx 0 34rpx 18rpx;
				padding-left: 18rpx;
				display: flex;
				align-items: center;
				font-size: 32rpx;
				// width: 70%;

				.inputPla {
					color: #AAAFB5;
					font-weight: 500;
				}

				/deep/ .inputPla {
					color: #AAAFB5;
					font-weight: 500;
				}
			}

			.forgetPassword {
				position: absolute;
				top: 50%;
				transform: translateY(-50%);
				right: 47rpx;
				font-size: 32rpx;
				color: #AAAFB5;
			}
		}

		.loginButton {
			background-color: #419AFF;
			display: flex;
			justify-content: center;
			align-items: center;
			color: #fff;
			font-size: 32rpx;
		}

		.registerButton {
			background-color: #F6F9FE;
			display: flex;
			justify-content: center;
			align-items: center;
			color: #419AFF;
		}
	}
</style>